package wpmp.auth.dao;

import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Component;

/**
 * @author Wayne.Wang<5waynewang@gmail.com>
 * @since 1:47:02 PM Dec 26, 2012
 */
@Component
public class CodeDao extends BaseDao {

	private static final String SQL_LIST = "SELECT a.type AS sort_type,b.text,b.value,b.order_num FROM sys_code_sort a,sys_code b WHERE a.id=b.sort_id AND a.type=? ORDER BY order_num";

	public SqlRowSet queryForRowSet(final String sortType) {
		return getJdbcTemplate().queryForRowSet(SQL_LIST, sortType);
	}
}
